package com.xframe.domain.e3sp.basedata;

import com.xframe.domain.BaseModel;
import com.xframe.xdal.core.annotation.*;
import com.xframe.xdal.core.constant.AutoFillType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * @Description: 替代件
 * @ClassName: com.xframe.domain.e3sp.basedata.PartReplace
 * @Author: lmx
 * @CreateTime: 2024/01/14
 **/
@Data
@Accessors(chain=true)
@XTable(value = "p_t02_replace", label = "替代件")
@XSelectItem(keyName = "replaceId",codeName = "replaceCode",textName = "replaceCode")
@XHasMany(typeName = "com.xframe.domain.e3sp.basedata.PartReplaceDetail",foreignKey = "replaceId", targetKey = "replaceId",as = "partReplaceList")
public class PartReplace extends BaseModel {
    /**
     * 替代件ID
     */
    @AutoFill(AutoFillType.Snowflake)
    @XColumn(name = "replace_id", primaryKeyFlag = true,desc = "替代件ID")
    private Long replaceId;

    /**
     * 替代件号
     */
    @XQueryCondition
    @XColumn(name = "replace_code", uniqueFlag = true,desc = "替代件号",length = 200)
    @XGridTableRef
    private String replaceCode;

    /**
     * 备注
     */
    @XColumn(name = "remark",desc = "备注",length = 500,nullFlag = true)
    private String remark;

    /**
     * 替代件明细列表
     */
    private List<PartReplaceDetail> partReplaceList;
}
